-- GENERATED SPELL FOR [Crystalline Keeper] --


function spell0_26782(pUnit, Event) --@Crystal Bark,Self--
pUnit:FullCastSpellOnTarget(47699,pUnit)
pUnit:RegisterEvent('Sorts_26782', 0, 1)
end

function spell1_26782(pUnit, Event) --@Crystal Strike,n/a--
pUnit:FullCastSpellOnTarget(33688,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26782', 640, 1)
end

function spell2_26782(pUnit, Event) --@Crystal Strike,n/a--
pUnit:FullCastSpellOnTarget(57052,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26782', 641, 1)
end

function Sorts_26782(pUnit, Event)
local choix_sorts_26782 = math.random(0, 2)
if choix_sorts_26782 == 0 then
pUnit:RegisterEvent('spell0_26782', 1, 1)
end
if choix_sorts_26782 == 1 then
pUnit:RegisterEvent('spell1_26782', 1, 1)
end
if choix_sorts_26782 == 2 then
pUnit:RegisterEvent('spell2_26782', 1, 1)
end
end

function mob26782_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_26782', math.random(1500, 3000), 1)
end

function mob26782_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26782_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26782_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(26782, 1, 'mob26782_Action')
RegisterUnitEvent(26782, 2, 'mob26782_Leave')
RegisterUnitEvent(26782, 3, 'mob26782_Kill')
RegisterUnitEvent(26782, 4, 'mob26782_Die')
